import { http } from "@/utils/http";
import { baseUrlApi } from "./utils";

/** 登录 */
export const getLogin = (data?: object) => {
  return http.request<any>("post", baseUrlApi("auth/login"), { data });
};
/** 图形验证码 */
export const getSetPicCode = (code: string) => {
  return http.request<any>("post", baseUrlApi("auth/setPicCode"), {
    data: {picCode: code},
  });
};
/** 发送短信验证码 */
export const getSendCode = (data?: object) => {
  return http.request<any>("post", baseUrlApi("auth/sendCode"), { data });
};

/** 用户详情 */
export const getUser = (data?: object) => {
  return http.request<any>("post", baseUrlApi("user/user_info"), { data });
};

/** 路由列表 */
export const getLuYou = (data?: object) => {
  return http.request<any>("post", baseUrlApi("user/user_luyou"), { data });
};

/** 部门列表 */
export const department_list = (data?: object) => {
  return http.request<any>("post", baseUrlApi("user/department_list"), {
    data
  });
};

/** 部门添加 */
export const department_add = (data?: object) => {
  return http.request<any>("post", baseUrlApi("user/department_add"), { data });
};

/** 部门编辑 */
export const department_save = (data?: object) => {
  return http.request<any>("post", baseUrlApi("user/department_save"), {
    data
  });
};

/** 部门删除 */
export const department_del = (data?: object) => {
  return http.request<any>("post", baseUrlApi("user/department_del"), { data });
};

/** 职位列表 */
export const position_list = (data?: object) => {
  return http.request<any>("post", baseUrlApi("user/position_list"), { data });
};

/** 职位添加 */
export const position_add = (data?: object) => {
  return http.request<any>("post", baseUrlApi("user/position_add"), { data });
};

/** 职位编辑 */
export const position_save = (data?: object) => {
  return http.request<any>("post", baseUrlApi("user/position_save"), { data });
};

/** 职位删除 */
export const position_del = (data?: object) => {
  return http.request<any>("post", baseUrlApi("user/position_del"), { data });
};

/** 角色列表 */
export const role_list = (data?: object) => {
  return http.request<any>("post", baseUrlApi("user/role_list"), { data });
};

/** 角色添加 */
export const role_add = (data?: object) => {
  return http.request<any>("post", baseUrlApi("user/role_add"), { data });
};

/** 角色编辑 */
export const role_save = (data?: object) => {
  return http.request<any>("post", baseUrlApi("user/role_save"), { data });
};

/** 角色删除 */
export const role_del = (data?: object) => {
  return http.request<any>("post", baseUrlApi("user/role_del"), { data });
};

/** 成员列表 */
export const user_list = (data?: object) => {
  return http.request<any>("post", baseUrlApi("member/user_list"), { data });
};

/** 成员添加 */
export const user_add = (data?: object) => {
  return http.request<any>("post", baseUrlApi("member/user_add"), { data });
};

/** 成员编辑 */
export const user_save = (data?: object) => {
  return http.request<any>("post", baseUrlApi("member/user_save"), { data });
};

/** 成员删除 */
export const user_del = (data?: object) => {
  return http.request<any>("post", baseUrlApi("member/user_del"), { data });
};

/** 公告列表 */
export const announcement_list = (data?: object) => {
  return http.request<any>("post", baseUrlApi("user/announcement_list"), {
    data
  });
};

/** 公告阅读 */
export const announcement_lock = (data?: object) => {
  return http.request<any>("post", baseUrlApi("user/announcement_lock"), {
    data
  });
};
